package cn.vote.uitls;

public class JsonResult {
	private int code;
	private JsonResultType resultType;
	private String message;
	private String logMessage;
	private Object appendData;
	
	public JsonResult(JsonResultType resultType) {
		this.resultType = resultType;
		setCode(resultType.getCode());
	}
	
	public JsonResult(JsonResultType resultType, String message) {
		this(resultType);
		this.message = message;
	}
	public JsonResult(JsonResultType resultType, String message, String logMessage) {
		this(resultType,message);
		this.logMessage = logMessage;
	}
	public JsonResult(JsonResultType resultType, String message, String logMessage, Object appendData) {
		this(resultType,message,logMessage);
		this.appendData = appendData;
	}

	public int getCode() {
		return code;
	}

	private void setCode(int code) {
		this.code = code;
	}

	public JsonResultType getResultType() {
		return resultType;
	}

	public void setResultType(JsonResultType resultType) {
		this.resultType = resultType;
		setCode(resultType.getCode());
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getLogMessage() {
		return logMessage;
	}

	public void setLogMessage(String logMessage) {
		this.logMessage = logMessage;
	}

	public Object getAppendData() {
		return appendData;
	}

	public void setAppendData(Object appendData) {
		this.appendData = appendData;
	}

	@Override
	public String toString() {
		return "JsonResult [code=" + code + ", resultType=" + resultType + ", message=" + message + ", logMessage="
				+ logMessage + ", appendData=" + appendData + "]";
	}
	
}
